Skip to content

Specialize SPPF nodes and optimize child node comparisons#50

Open
RodionovMaxim05 wants to merge 3 commits intoFormalLanguageConstrainedPathQuerying:mainfrom
RodionovMaxim05:optimization
Open

Specialize SPPF nodes and optimize child node comparisons#50
RodionovMaxim05 wants to merge 3 commits intoFormalLanguageConstrainedPathQuerying:mainfrom
RodionovMaxim05:optimization

Conversation

@RodionovMaxim05
Copy link

@RodionovMaxim05 RodionovMaxim05 commented Mar 11, 2026

  • Replaced the single RangeSppfNode data class with a class hierarchy specialized by the number of child elements
  • Changed the child element identity check from equality to reference equality (===)

hasChild can use === (reference equality) instead of equals, since SppfStorage deduplicates all nodes through createdSppfNodes - the same node always maps to the same object reference.

Comparison results of CFL-based approximation methods for interleaved Dyck reachability using the optimized and original versions: https://drive.google.com/drive/folders/1B3elWZ52mO4g0gTj9mP1td56DraU_qmi?usp=sharing. There are graphs of time and memory (as well as the results themselves)

@gsvgit gsvgit requested a review from bachish March 20, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant